/**
 * 
 */
package com.yangtao.prototype.system.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.yangtao.framework.hibernate.BaseEntity;

/**
 * 角色对应的页面元素权限
 * 
 * @author 杨涛
 * 
 */
@Entity
@Table(name="sys_pag_ele_auth")
public class PageElementAuth extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 权限对应的角色
	 */
	@ManyToOne(fetch = FetchType.LAZY, optional = false)
	@JoinColumn(name = "roleId")
	private Role role;
	/**
	 * 权限对应的元素
	 */
	@ManyToOne(fetch = FetchType.LAZY, optional = false)
	@JoinColumn(name = "elementId")
	private PageElement element;

	/**
	 * 角色对应的页面元素权限值
	 */
	@Column(length = 10)
	private String value;

	/**
	 * @return the role
	 */
	public Role getRole() {
		return role;
	}

	/**
	 * @param role
	 *            the role to set
	 */
	public void setRole(Role role) {
		this.role = role;
	}

	/**
	 * @return the element
	 */
	public PageElement getElement() {
		return element;
	}

	/**
	 * @param element
	 *            the element to set
	 */
	public void setElement(PageElement element) {
		this.element = element;
	}

	/**
	 * @return the value
	 */
	public String getValue() {
		return value;
	}

	/**
	 * @param value
	 *            the value to set
	 */
	public void setValue(String value) {
		this.value = value;
	}
}
